﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Razor.TagHelpers;

namespace Kugar.UI.Web.AdminLTE.PageControls.PageCommon
{
    /// <summary>
    /// 用于检查
    /// </summary>
    public class PageCommon_AuthroityChecker:ContainerBase
    {
        public PageCommon_AuthroityChecker(ViewContext viewContext) : base(viewContext)
        {
        }

        public override void Dispose()
        {
            throw new NotImplementedException();
        }

        internal override ContainerBase RenderInternal()
        {
            throw new NotImplementedException();
        }
    }


    [HtmlTargetElement("authroiry")]
    public class FormButtonTagHelper : TagHelper
    {
        public string Type { get; set; } = "Submit";

        public string BgColor { get; set; } = "primary";

        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            output.TagName = "button";
            output.TagMode = TagMode.StartTagAndEndTag;
            output.Attributes.SetAttribute("class", $"btn btn-{BgColor}");
            output.Attributes.SetAttribute("type", Type);
            output.Content.SetContent(Type == "submit" ? "Add" : "Reset");
        }
        
    }
}
